<template>
    <p>
        每次增加1：<button @click="increment">+</button>
        数字：{{ $store.state.add }}
    </p>
    <p>
        每次减少1：<button @click="reduction">-</button>
        数字：{{ $store.state.reduce }}
    </p>
</template>
<script setup>
import {useStore} from 'vuex'
const store = useStore()
const increment = () => {
    store.commit('increase')
}
const reduction = () => {
    store.commit('decrease')
}
</script>
<style scpped>
button{
    background-color: aquamarine;
}
</style>